package com.twu.biblioteca.actions;

import com.twu.biblioteca.exceptions.BaseError;
import com.twu.biblioteca.persistences.Books;

public class ListAvailableBooksAction extends BaseAction {
    private Books allBooks;

    public ListAvailableBooksAction(Books rootBooksInstance){
        allBooks = rootBooksInstance;
    }

    @Override
    public void run() throws BaseError {
        super.run();
        allBooks.available().print();
    }

    @Override
    public String actionName() {
        return "List all available books";
    }
}
